home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
comm
/
mail
/
thor201.lha
/
THOR_2.0
/
UpdateThor
< prev
next >
Wrap
Text File
|
1995-05-15
|
15KB
|
568 lines
;*************************************************************************
; Title:
; UpdateThor
;*************************************************************************
; Description:
; Commodore Installer Script for the Thor 2.0 software
;*************************************************************************
; Author:
; Øyvind Ellefsen - versions for THOR upto 1.22
; Petter Nilsen - versions for 1.25 ->
;*************************************************************************
; Still to do:
; - THOR.macros might not be correct. Notify user?
; - Handle previous installations with one of the env-vars/assigns
; missing.
; - Show .readme file
; - Check in libs:,l: too for libraries.
; - Not delete catalogs/, only the needed dirs
;
;*************************************************************************
;
;******************************************************
;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
;******************************************************
; some useful variables
(set true 1)
(set false 0)
(set yes true)
(set no false)
(set is_a_file 1)
(set is_a_dir 2)
(set quote "\"")
(set newline "\n")
(set nothing "")
(set V3_Update no)
; set up our delete options
(delopts "AskUser" "OkNoDelete" "Force")
; some useful procedures
; change userlevel to expert
(procedure expert_level
(
(user 2)
)
)
; reset userlevel back to default
(procedure default_level
(
(user default-level)
)
)
; store off userlevel
(procedure save_default_level
(
(set default-level @user-level)
)
)
; some overused strings
(set omp (cat "One moment please..." newline))
; introduce ourselfs to the viewers
(welcome "Welcome to the Thor installer. This installer uses "
"the Commodore Amiga Installer. All of our future Thor releases "
"will be using this installer and we would like to get any feedback "
"that might help to improve the installation procedure." newline
)
; first reset the user level so that the novice can see whats going on
(save_default_level)
(expert_level)
;Make assign to install from
(makeassign "Thor_Install" "" (safe))
;******************
;** Check Memory **
;******************
(run "Avail flush")
(set Running (run "Thor_Install:CheckForLib"))
(while (= Running 20)
((Message newline "Thor seem to be running, you MUST close it NOW."
newline "If you don't, the installation will fail!")
(run "Avail flush")
(set Running (run "Thor_Install:CheckForLib")))
)
;************************
;** Start Installation **
;************************
(if (exists "ENV:THOR/THORPath" (noreq))
(
(if (set Thor_Dir (getenv "THOR/THORPath"))
(
(set Thor_Dir (substr Thor_Dir 0 (- (strlen Thor_Dir) 1)))
(set Thor_Dir (expandpath Thor_Dir))
(set V3_Update yes)
(makeassign "Thor" Thor_Dir (safe))
)
; Else
(
(if (exists "Thor:libs/bbsread.library" (noreq))
; Then
(
(set Thor_Dir (expandpath "Thor:"))
)
; Else
(
(set end_text "Please use the InstallThor script for a first-time installation.")
(abort end_text))
)
)
)
)
; Else
(
(if (exists "Thor:libs/bbsread.library" (noreq))
; Then
(
(set Thor_Dir (expandpath "Thor:"))
)
; Else
(
(set end_text "Please use the InstallThor script for a first-time installation.")
(abort end_text))
)
)
)
(if (exists "ENV:THOR/THORPath" (noreq))
(
(if (set BBSData_Dir (getenv "THOR/BBSDataPath"))
(
(set BBSData_Dir (substr BBSData_Dir 0 (- (strlen BBSData_Dir) 1)))
(set BBSData_Dir (expandpath BBSData_Dir))
(set V3_Update yes)
(makeassign "BBSData" BBSData_Dir (safe))
)
; Else
(
(if (exists "BBSData:global.config" (noreq))
; Then
(
(set BBSData_Dir (expandpath "BBSData:"))
)
; Else
(
(set end_text "Please use the InstallThor script for a first-time installation.")
(abort end_text))
)
)
)
)
; Else
(
(if (exists "BBSData:global.config" (noreq))
; Then
(
(set BBSData_Dir (expandpath "BBSData:"))
)
; Else
(
(set end_text "Please use the InstallThor script for a first-time installation.")
(abort end_text))
)
)
)
;**********************************************
;** Hostile deletion of old files here.. ******
;**********************************************
(if (= V3_Update no)
(
(if (askbool
(prompt "Several old files left over from the the THOR 1.x" newline
"releases are now obsolete and should be deleted." newline
"This applies to the following directories: " newline
"THOR:bin, THOR:s, THOR:rexx, THOR:libs and THOR:Scripts. " newline
"If you have made any ARexx-scripts for Thor 1.xx,\n"
"they might not work anymore. Check out the new\n"
"ARexx-documentation and change your scripts accordingly.\n\n"
"You might want to make a backup of personal files " newline
"before proceeding." newline
"Press 'Yes' to continue with deletion of obsolete files")
(help
"The installer has determined that you may already have a "
"copy of Thor installed on your system. "
"Several files have changed and should be deleted since they "
"will not function correctly with this release of THOR. "
)
(default 1)
)
; Then
(
(run "Delete THOR:ThorStat#?")
(run "Delete THOR:THOR.history")
(run "Delete THOR:libs/#?")
(run "Delete THOR:bin/#?")
(run "Delete THOR:s/#?")
(run "Delete THOR:rexx/~(postinglists)")
(run "Delete THOR:Scripts/#?")
(run "Delete THOR:#?guide#?")
(run "Delete THOR:THOR")
(run "Rename THOR:THOR.info THOR:THOR.old.info")
(run "Delete THOR:THOR.info")
(run "Delete libs:bbsread.library")
)
)
)
)
; Else
(
(if (askbool
(prompt
"Due to a problem with MultiUser filesystem, "
"old files must be deleted before installing "
"the new files. This is not needed if you do not "
"run this filesystem on the partition THOR is "
"installed on. Please take a backup of any personal ARexx "
"scripts you might have made before selecting 'Yes' here.\n\n"
"Press 'Yes' to continue with deletion of old files.")
(help
"The installer has determined that you may already have a "
"copy of Thor installed on your system. "
"Old files from a previous installation must be deleted "
"if you are running the MultiUser filesystem on the "
"partition THOR is installed on."
)
(default 1)
)
; Then
(
(run "Delete THOR:ThorStat#?")
(run "Delete THOR:THOR.history")
(run "Delete THOR:libs/#?")
(run "Delete THOR:l/#?")
(run "Delete THOR:docs/#?")
(run "Delete THOR:bin/#?")
(run "Delete THOR:s/#?")
(run "Delete THOR:unix/#?")
(run "Delete THOR:rexx/~(postinglists) all")
(run "Delete THOR:Scripts/#?")
(run "Delete THOR:#?guide#?")
(run "Delete THOR:THOR")
(run "Rename THOR:THOR.info THOR:THOR.old.info")
(run "Delete THOR:THOR.info")
(run "Delete THOR:ConfigTHOR")
(run "Delete THOR:ConfigTHOR.info")
(run "Delete libs:bbsread.library")
(run "Delete libs:bbsreadcnv2.library")
(run "Delete l:bbsread-handler")
(run "Delete l:bbsreadrexx-handler")
)
)
)
(run "Delete THOR:bin/initsoup")
(run "Delete THOR:bin/configuucp")
;******************
;** Locale stuff **
;******************
(default_level)
(set name
(askoptions
(prompt "What languages would you like to install ? English" newline
"is the built in language.")
(help
"This will install locale files for other languages than English. "
"You can set the prefered language on Workbench and in Thor by"
"using the prefs:locale tool." newline @askchoice-help
)
(choices "Norsk")
(default 0)
)
)
; Delete previous installed catalog files.
(if (= V3_Update yes)
(
(run "delete thor:catalogs all")
)
)
(if (<> 0 name)
(makedir "thor:catalogs")
)
(if (bitand 1 name)
(copyfiles
(source "Thor_Install:catalogs/norsk")
(dest "thor:catalogs/norsk")
(all)
))
;***********************************
;***** GET FIRST DISK IN HERE ******
;***********************************
; first copy over the stuff
(working omp "Decompressing and copying Thor files.")
(run "Thor_Install:lhex -a -f -w=THOR: x Thor_Install:thor.lha" )
;*********************
;** reqtools.libary **
;*********************
(copylib
(prompt "Copying ReqTools library")
(help "This will copy the ReqTools library." newline @copylib-help)
(source "Thor_Install:reqtools.library")
(dest "libs:")
)
;************************
;** Copy the keyfile **
;************************
(if (exists "Thor_Install:THOR.key" (noreq))
; Then
(copyfiles
(source "Thor_Install:THOR.key")
(dest "THOR:")
)
)
;**********************************************
;* Convert the database to the new 2.0 format *
;**********************************************
(run "thor:bin/InitCharsets")
(default_level)
(if (= V3_Update no)
(
(message newline "The installer will now convert and upgrade the "
newline "message database to the new 2.0 format."
newline "This might take some time, so please be patient.")
(run "Avail flush")
(set Running (run "Thor:bin/basemanager convert >con:0/0/640/200/Converting/AUTO/CLOSE/WAIT"))
(if (<> 0 Running)
(
((set end_text "Conversion of your old database failed." newline "Please take notice of the error message shown.")
(abort end_text)))
)
)
(run "thor:bin/initarc")
)
(execute "thor:s/cfgqwk")
(execute "thor:s/cfgfido")
(execute "thor:s/cfgblue")
(execute "thor:s/cfguqwk_soup")
(execute "thor:s/cfguucp")
(execute "thor:s/cfgsoup")
(execute "thor:s/cfgabbs")
(execute "thor:s/cfgabbs_qwk")
(execute "thor:s/cfgmbbs")
(execute "thor:s/cfgbbbs")
(execute "thor:s/cfghippo")
(execute "thor:s/cfgomen")
;*********************************************
;** Copy configfiles from BBSDATA: to THOR: **
;*********************************************
(if (= V3_Update no)
(
(run "copy bbsdata:visual.config thor:visual.config")
(run "copy bbsdata:global.config thor:global.config")
(run "copy bbsdata:fse.config thor:fse.config")
)
)
;***********
;** Fonts **
;***********
(if (= V3_Update no)
(
(copyfiles
(prompt "Choose the fonts to install with Thor" newline "These are not required for Thor to run" )
(help "This will copy the default font files for Thor." newline @copyfiles-help)
(source "Thor_Install:Fonts")
(dest "Fonts:")
(fonts)
(choices "Grn" "Thin609" "Thin611" "Thin711")
(confirm)
)
)
)
;***************
;** LogReader **
;***************
;(if (askbool
; (prompt newline "Do you want the LogReader software installed?")
; (help newline "The LogReader software is a program for" newline
; "calculating phone-bills from logfiles." newline
; newline "Select YES if you want it installed, otherwise NO")
; (default 1)
; )
;
;; Then
; (copyfiles
; (prompt "Copying LogReader files")
; (help "This will copy the files needed by LogReader." newline @copyfiles-help)
; (source "Thor_Install:LogReader")
; (dest Thor_dir)
; (all)
; (infos)
; )
;)
;
;****************
;** AmigaGuide **
;****************
(if (= V3_Update no)
(
(if (askbool
(prompt newline "Do you want the AmigaGuide" newline "program and library installed?"
newline newline "If you have a newer version of the library" newline
"on your system, it will NOT be overwritten")
(help newline "The AmigaGuide library is needed for the Thor documentation"
newline "and the online help system in Thor."
newline newline "Select YES if you want it installed, otherwise NO")
(default 1)
)
; Then
(
(copyfiles
(prompt "Copying AmigaGuide program file")
(help "This will copy the files needed by AmigaGuide." newline @copyfiles-help)
(source "Thor_Install:AmigaGuide")
(dest "sys:Utilities")
)
(copylib
(prompt "Copying AmigaGuide library")
(help "This will copy the AmigaGuide library." newline @copylib-help)
(source "Thor_Install:amigaguide.library")
(dest "libs:")
)
)
)
)
)
;*****************************
;****** Install icons ********
;*****************************
(if (askbool
(prompt newline "Do you want to install MagicWB " newline
"versions of the program and drawer icons?" newline)
(help newline "If you are using MagicWB on your Workbench, "
newline "you might want to install the special MagicWB icons."
newline newline "Select YES if you want it installed, otherwise NO")
(default 1)
)
; Then
(
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons")
(dest "Thor:")
(pattern "~(THOR.guide.info)")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "THOR.guide.info")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "ConfigTHOR.guide.info")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "ARexx.guide.info")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "BBSReadRexx.guide.info")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "THOR_Rexx.guide.info")
(nogauge)
)
(copyfiles
(prompt "Copying MagicWB icon files")
(source "Thor_Install:MWBIcons/THOR.guide.info")
(dest "Thor:Docs")
(newname "Installation.guide.info")
(nogauge)
)
)
)
(if (exists "env:sys/def_drawer.info" (noreq))
(copyfiles
(prompt "Copying default drawer icon")
(help "This will copy the default drawer icon." newline @copyfiles-help)
(source "env:sys/def_drawer.info")
(dest "Thor:")
(newname "Docs.info")
(infos)
)
)
;*****************************
;***** WE ARE ALMOST DONE ****
;*****************************
; make sure that default-dir is pointing to the right place
(set @default-dest Thor_Dir)
; final message for our viewers
(set end_text (cat "Hope you like THOR! Don't hesitate to "
"send us comments, bugreports and suggestions."))
(makeassign "Thor_Install")
(makeassign "Thor_Disk" (safe))
(if (= V3_Update yes)
(
(makeassign "BBSData")
)
)
; now for the exit
(exit end_text)